package javaBase.LinkList;

import java.util.ArrayList;
import java.util.LinkedList;

/**
 * @program: jvm
 * @description
 * @author: tkk fendoukaoziji
 * @create: 2019-05-01 10:08
 **/
public class Test {
    public static void main(String[] args) {
        LinkedList<Object> objects = new LinkedList<>();
        ArrayList<Object> objects1 = new ArrayList<>();
        MyLinkList myList = new MyLinkList();
        myList.insertFirst(22,2.14);
        myList.insertFirst(44,4.23);
        myList.insertFirst(33,3.23);
        myList.insertFirst(66,6.23);
        myList.displayList();

     /*   while (!myList.isEmpty()){
            Link deleteLink = myList.deleteFirst();
            System.out.print("Delete :");
            deleteLink.displayLink();
            System.out.println(" ");
        }*/
        Link findList = myList.find(55);
        if(findList!=null){
            System.out.println("找到值"+findList.getiData());
        }else{
            System.out.println("不存在");
        }

        Link deleteLink = myList.delete(55);
        if(deleteLink!=null){
            System.out.println("删除link "+deleteLink.getiData());
        }else {
            System.out.println("不存在");
        }
        myList.displayList();

    }
}























